﻿using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using AOP;
using BusinessRules;
using BusinessRules.Undo;
using SpecUnit;

namespace ProfilingApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var factory = new RuleFactory<EntityWithNotify>();
            var rule = factory.CreateValidationRule(en => en.Number > 5);

            TestTime.Start(1e6, () => {
                                      var e = new EntityWithNotify();
                                      e.Rules.AddRuleFromPrototype(rule);
                                  });
        }
    }

    public class EntityWithNotify : EntityBase<EntityWithNotify>, INotifyPropertyChanged
    {
        public EntityWithNotify()
        {
        }

        public string Name { get; set; }
        public int Number { get; set; }
        public int Number2 { get; set; }
        public int Number3 { get; set; }
        public EntityWithNotify Child { get; set; }


        public void SetNumber2(int value)
        {
            Number2 = value;
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
